<template>
    <div class="job-consultant">
        <div class="job-consultant-head">职位专属顾问</div>
        <div class="job-consultant-content">
            <img :src="platformUser.headImage?platformUser.headImage:defaultIcon" alt>
            <div class="content-right">
                <el-row class="consultant-name">{{platformUser.nickName?platformUser.nickName:'未知'}}</el-row>
                <el-row class="consultant-phone">
                    <div style="display: flex;align-items: center">
                        <img src="../assets/img/resume/phone.png" alt>
                        {{platformUser.phone?platformUser.phone:'未知'}}
                    </div>
                </el-row>
                <el-row>
                    <div style="display: flex;align-items: center">
                        <img src="../assets/img/resume/work_time.png" alt style="margin:0 10px 0 0;">
                        {{platformUser.workTime?platformUser.workTime:'未知'}}
                    </div>
                </el-row>
            </div>
            <el-button @click="chatConsultant" class="primary-button">在线沟通</el-button>
        </div>
    </div>
</template>

<script>
  import _subject from '../assets/utils/subject'
  import _g from '../assets/utils/global'

  export default {
    data() {
      return {
        defaultIcon: require('../assets/img/resume/con_default.png'),
        platformUser: {}
      }
    },
    components: {},
    methods: {
      loadAdviser() {
        _g.apiPost('/company/selectPlatformByComId.do', {})
          .then(res => {
            if (res && res.status === 0) {
              let t = res.data
              if (t) {
                this.platformUser = t
              }
            }
          })
      },
      chatConsultant() {
        _g.getCache().gc = { g: 1, c: 1 }
        this.$router.push({ path: '/communication/Corporate' })
      }
    },
    created() {
      this.loadAdviser()
    }
  }
</script>

<style lang="scss" scoped>
    .job-consultant {
        width: 280px;
        height: 250px;
        padding: 0 20px;
        margin: 0 0 20px 0;
        background: #fff;
        box-sizing: border-box;
        box-shadow: 0px 3px 7px 0px rgba($color: #000, $alpha: 0.1);

        .job-consultant-head {
            padding: 23px 0 29px 0;
            font-size: 16px;
            color: #000;
            font-weight: 400;
        }

        .job-consultant-content {
            img {
                float: left;
                width: 81px;
                height: 81px;
            }

            .content-right {
                width: 130px;
                margin: 0 0 0 16px;
                float: left;

                img {
                    width: 15px;
                    height: 15px;
                }

                .el-row {
                    font-size: 14px;
                    color: #666;
                }

                .consultant-name {
                    margin: 0 0 13px 0;
                    font-size: 18px;
                    color: #333;
                }

                .consultant-phone {
                    font-size: 14px;
                    margin: 0 0 11px 0;

                    img {
                        margin: 0 10px 0 0;
                    }
                }
            }

            .el-button {
                width: 240px;
                height: 40px;
                margin: 30px 0 0 0;
                border-radius: 0;
                background: #f09338;
                border: none;
            }
        }
    }
</style>
